(0) Obligation:
Runtime Complexity TRS:
The TRS R consists of the following rules:
rev(nil) → nil
rev(++(x, y)) → ++(rev1(x, y), rev2(x, y))
rev1(x, nil) → x
rev1(x, ++(y, z)) → rev1(y, z)
rev2(x, nil) → nil
rev2(x, ++(y, z)) → rev(++(x, rev(rev2(y, z))))
Rewrite Strategy: FULL
(1) RenamingProof (EQUIVALENT transformation)
Renamed function symbols to avoid clashes with predefined symbol.
(2) Obligation:
Runtime Complexity Relative TRS:
The TRS R consists of the following rules:
rev(nil) → nil
rev(++(x, y)) → ++(rev1(x, y), rev2(x, y))
rev1(x, nil) → x
rev1(x, ++(y, z)) → rev1(y, z)
rev2(x, nil) → nil
rev2(x, ++(y, z)) → rev(++(x, rev(rev2(y, z))))
S is empty.
Rewrite Strategy: FULL
(3) TypeInferenceProof (BOTH BOUNDS(ID, ID) transformation)
Infered types.
(4) Obligation:
TRS:
Rules:
rev(nil) → nil
rev(++(x, y)) → ++(rev1(x, y), rev2(x, y))
rev1(x, nil) → x
rev1(x, ++(y, z)) → rev1(y, z)
rev2(x, nil) → nil
rev2(x, ++(y, z)) → rev(++(x, rev(rev2(y, z))))
Types:
rev :: nil:++ → nil:++
nil :: nil:++
++ :: rev1 → nil:++ → nil:++
rev1 :: rev1 → nil:++ → rev1
rev2 :: rev1 → nil:++ → nil:++
hole_nil:++1_0 :: nil:++
hole_rev12_0 :: rev1
gen_nil:++3_0 :: Nat → nil:++
(5) OrderProof (LOWER BOUND(ID) transformation)
Heuristically decided to analyse the following defined symbols:
rev,
rev1,
rev2They will be analysed ascendingly in the following order:
rev1 < rev
rev = rev2
(6) Obligation:
TRS:
Rules:
rev(
nil) →
nilrev(
++(
x,
y)) →
++(
rev1(
x,
y),
rev2(
x,
y))
rev1(
x,
nil) →
xrev1(
x,
++(
y,
z)) →
rev1(
y,
z)
rev2(
x,
nil) →
nilrev2(
x,
++(
y,
z)) →
rev(
++(
x,
rev(
rev2(
y,
z))))
Types:
rev :: nil:++ → nil:++
nil :: nil:++
++ :: rev1 → nil:++ → nil:++
rev1 :: rev1 → nil:++ → rev1
rev2 :: rev1 → nil:++ → nil:++
hole_nil:++1_0 :: nil:++
hole_rev12_0 :: rev1
gen_nil:++3_0 :: Nat → nil:++
Generator Equations:
gen_nil:++3_0(0) ⇔ nil
gen_nil:++3_0(+(x, 1)) ⇔ ++(hole_rev12_0, gen_nil:++3_0(x))
The following defined symbols remain to be analysed:
rev1, rev, rev2
They will be analysed ascendingly in the following order:
rev1 < rev
rev = rev2
(7) RewriteLemmaProof (LOWER BOUND(ID) transformation)
Proved the following rewrite lemma:
rev1(
hole_rev12_0,
gen_nil:++3_0(
n5_0)) →
hole_rev12_0, rt ∈ Ω(1 + n5
0)
Induction Base:
rev1(hole_rev12_0, gen_nil:++3_0(0)) →RΩ(1)
hole_rev12_0
Induction Step:
rev1(hole_rev12_0, gen_nil:++3_0(+(n5_0, 1))) →RΩ(1)
rev1(hole_rev12_0, gen_nil:++3_0(n5_0)) →IH
hole_rev12_0
We have rt ∈ Ω(n1) and sz ∈ O(n). Thus, we have ircR ∈ Ω(n).
(8) Complex Obligation (BEST)
(9) Obligation:
TRS:
Rules:
rev(
nil) →
nilrev(
++(
x,
y)) →
++(
rev1(
x,
y),
rev2(
x,
y))
rev1(
x,
nil) →
xrev1(
x,
++(
y,
z)) →
rev1(
y,
z)
rev2(
x,
nil) →
nilrev2(
x,
++(
y,
z)) →
rev(
++(
x,
rev(
rev2(
y,
z))))
Types:
rev :: nil:++ → nil:++
nil :: nil:++
++ :: rev1 → nil:++ → nil:++
rev1 :: rev1 → nil:++ → rev1
rev2 :: rev1 → nil:++ → nil:++
hole_nil:++1_0 :: nil:++
hole_rev12_0 :: rev1
gen_nil:++3_0 :: Nat → nil:++
Lemmas:
rev1(hole_rev12_0, gen_nil:++3_0(n5_0)) → hole_rev12_0, rt ∈ Ω(1 + n50)
Generator Equations:
gen_nil:++3_0(0) ⇔ nil
gen_nil:++3_0(+(x, 1)) ⇔ ++(hole_rev12_0, gen_nil:++3_0(x))
The following defined symbols remain to be analysed:
rev2, rev
They will be analysed ascendingly in the following order:
rev = rev2
(10) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol rev2.
(11) Obligation:
TRS:
Rules:
rev(
nil) →
nilrev(
++(
x,
y)) →
++(
rev1(
x,
y),
rev2(
x,
y))
rev1(
x,
nil) →
xrev1(
x,
++(
y,
z)) →
rev1(
y,
z)
rev2(
x,
nil) →
nilrev2(
x,
++(
y,
z)) →
rev(
++(
x,
rev(
rev2(
y,
z))))
Types:
rev :: nil:++ → nil:++
nil :: nil:++
++ :: rev1 → nil:++ → nil:++
rev1 :: rev1 → nil:++ → rev1
rev2 :: rev1 → nil:++ → nil:++
hole_nil:++1_0 :: nil:++
hole_rev12_0 :: rev1
gen_nil:++3_0 :: Nat → nil:++
Lemmas:
rev1(hole_rev12_0, gen_nil:++3_0(n5_0)) → hole_rev12_0, rt ∈ Ω(1 + n50)
Generator Equations:
gen_nil:++3_0(0) ⇔ nil
gen_nil:++3_0(+(x, 1)) ⇔ ++(hole_rev12_0, gen_nil:++3_0(x))
The following defined symbols remain to be analysed:
rev
They will be analysed ascendingly in the following order:
rev = rev2
(12) NoRewriteLemmaProof (LOWER BOUND(ID) transformation)
Could not prove a rewrite lemma for the defined symbol rev.
(13) Obligation:
TRS:
Rules:
rev(
nil) →
nilrev(
++(
x,
y)) →
++(
rev1(
x,
y),
rev2(
x,
y))
rev1(
x,
nil) →
xrev1(
x,
++(
y,
z)) →
rev1(
y,
z)
rev2(
x,
nil) →
nilrev2(
x,
++(
y,
z)) →
rev(
++(
x,
rev(
rev2(
y,
z))))
Types:
rev :: nil:++ → nil:++
nil :: nil:++
++ :: rev1 → nil:++ → nil:++
rev1 :: rev1 → nil:++ → rev1
rev2 :: rev1 → nil:++ → nil:++
hole_nil:++1_0 :: nil:++
hole_rev12_0 :: rev1
gen_nil:++3_0 :: Nat → nil:++
Lemmas:
rev1(hole_rev12_0, gen_nil:++3_0(n5_0)) → hole_rev12_0, rt ∈ Ω(1 + n50)
Generator Equations:
gen_nil:++3_0(0) ⇔ nil
gen_nil:++3_0(+(x, 1)) ⇔ ++(hole_rev12_0, gen_nil:++3_0(x))
No more defined symbols left to analyse.
(14) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
rev1(hole_rev12_0, gen_nil:++3_0(n5_0)) → hole_rev12_0, rt ∈ Ω(1 + n50)
(15) BOUNDS(n^1, INF)
(16) Obligation:
TRS:
Rules:
rev(
nil) →
nilrev(
++(
x,
y)) →
++(
rev1(
x,
y),
rev2(
x,
y))
rev1(
x,
nil) →
xrev1(
x,
++(
y,
z)) →
rev1(
y,
z)
rev2(
x,
nil) →
nilrev2(
x,
++(
y,
z)) →
rev(
++(
x,
rev(
rev2(
y,
z))))
Types:
rev :: nil:++ → nil:++
nil :: nil:++
++ :: rev1 → nil:++ → nil:++
rev1 :: rev1 → nil:++ → rev1
rev2 :: rev1 → nil:++ → nil:++
hole_nil:++1_0 :: nil:++
hole_rev12_0 :: rev1
gen_nil:++3_0 :: Nat → nil:++
Lemmas:
rev1(hole_rev12_0, gen_nil:++3_0(n5_0)) → hole_rev12_0, rt ∈ Ω(1 + n50)
Generator Equations:
gen_nil:++3_0(0) ⇔ nil
gen_nil:++3_0(+(x, 1)) ⇔ ++(hole_rev12_0, gen_nil:++3_0(x))
No more defined symbols left to analyse.
(17) LowerBoundsProof (EQUIVALENT transformation)
The lowerbound Ω(n1) was proven with the following lemma:
rev1(hole_rev12_0, gen_nil:++3_0(n5_0)) → hole_rev12_0, rt ∈ Ω(1 + n50)
(18) BOUNDS(n^1, INF)